3.763 \(\int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx\)

Optimal. Leaf size=58 \[ \frac {2 a^2 \tan (c+d x)}{d}-\frac {a^2 \cot (c+d x)}{d}+\frac {2 a^2 \sec (c+d x)}{d}-\frac {2 a^2 \tanh ^{-1}(\cos (c+d x))}{d} \]

[Out]

-2*a^2*arctanh(cos(d*x+c))/d-a^2*cot(d*x+c)/d+2*a^2*sec(d*x+c)/d+2*a^2*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.22, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 8, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {2873, 3767, 8, 2622, 321, 207, 2620, 14} \[ \frac {2 a^2 \tan (c+d x)}{d}-\frac {a^2 \cot (c+d x)}{d}+\frac {2 a^2 \sec (c+d x)}{d}-\frac {2 a^2 \tanh ^{-1}(\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]^2*Sec[c + d*x]^2*(a + a*Sin[c + d*x])^2,x]

[Out]

(-2*a^2*ArcTanh[Cos[c + d*x]])/d - (a^2*Cot[c + d*x])/d + (2*a^2*Sec[c + d*x])/d + (2*a^2*Tan[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2620

Int[csc[(e_.) + (f_.)*(x_)]^(m_.)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(1 + x^2)^((
m + n)/2 - 1)/x^m, x], x, Tan[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n)/2]

Rule 2622

Int[csc[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Dist[1/(f*a^n), Subst[Int
[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n
 + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rule 2873

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^(m_), x_Symbol] :> Int[ExpandTrig[(g*cos[e + f*x])^p, (d*sin[e + f*x])^n*(a + b*sin[e + f*x])^m, x], x]
 /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && IGtQ[m, 0]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin {align*} \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx &=\int \left (a^2 \sec ^2(c+d x)+2 a^2 \csc (c+d x) \sec ^2(c+d x)+a^2 \csc ^2(c+d x) \sec ^2(c+d x)\right ) \, dx\\ &=a^2 \int \sec ^2(c+d x) \, dx+a^2 \int \csc ^2(c+d x) \sec ^2(c+d x) \, dx+\left (2 a^2\right ) \int \csc (c+d x) \sec ^2(c+d x) \, dx\\ &=-\frac {a^2 \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}+\frac {a^2 \operatorname {Subst}\left (\int \frac {1+x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}+\frac {\left (2 a^2\right ) \operatorname {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=\frac {2 a^2 \sec (c+d x)}{d}+\frac {a^2 \tan (c+d x)}{d}+\frac {a^2 \operatorname {Subst}\left (\int \left (1+\frac {1}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}+\frac {\left (2 a^2\right ) \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=-\frac {2 a^2 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^2 \cot (c+d x)}{d}+\frac {2 a^2 \sec (c+d x)}{d}+\frac {2 a^2 \tan (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.39, size = 96, normalized size = 1.66 \[ \frac {a^2 \left (\tan \left (\frac {1}{2} (c+d x)\right )-\cot \left (\frac {1}{2} (c+d x)\right )+4 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+\frac {8 \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]^2*Sec[c + d*x]^2*(a + a*Sin[c + d*x])^2,x]

[Out]

(a^2*(-Cot[(c + d*x)/2] - 4*Log[Cos[(c + d*x)/2]] + 4*Log[Sin[(c + d*x)/2]] + (8*Sin[(c + d*x)/2])/(Cos[(c + d
*x)/2] - Sin[(c + d*x)/2]) + Tan[(c + d*x)/2]))/(2*d)

________________________________________________________________________________________

fricas [B]  time = 0.45, size = 192, normalized size = 3.31 \[ -\frac {3 \, a^{2} \cos \left (d x + c\right )^{2} + a^{2} \cos \left (d x + c\right ) - 2 \, a^{2} + {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2} + {\left (a^{2} \cos \left (d x + c\right ) + a^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2} + {\left (a^{2} \cos \left (d x + c\right ) + a^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (3 \, a^{2} \cos \left (d x + c\right ) + 2 \, a^{2}\right )} \sin \left (d x + c\right )}{d \cos \left (d x + c\right )^{2} + {\left (d \cos \left (d x + c\right ) + d\right )} \sin \left (d x + c\right ) - d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-(3*a^2*cos(d*x + c)^2 + a^2*cos(d*x + c) - 2*a^2 + (a^2*cos(d*x + c)^2 - a^2 + (a^2*cos(d*x + c) + a^2)*sin(d
*x + c))*log(1/2*cos(d*x + c) + 1/2) - (a^2*cos(d*x + c)^2 - a^2 + (a^2*cos(d*x + c) + a^2)*sin(d*x + c))*log(
-1/2*cos(d*x + c) + 1/2) - (3*a^2*cos(d*x + c) + 2*a^2)*sin(d*x + c))/(d*cos(d*x + c)^2 + (d*cos(d*x + c) + d)
*sin(d*x + c) - d)

________________________________________________________________________________________

giac [A]  time = 0.20, size = 98, normalized size = 1.69 \[ \frac {4 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {2 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 7 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/2*(4*a^2*log(abs(tan(1/2*d*x + 1/2*c))) + a^2*tan(1/2*d*x + 1/2*c) - (2*a^2*tan(1/2*d*x + 1/2*c)^2 + 7*a^2*t
an(1/2*d*x + 1/2*c) - a^2)/(tan(1/2*d*x + 1/2*c)^2 - tan(1/2*d*x + 1/2*c)))/d

________________________________________________________________________________________

maple [A]  time = 0.60, size = 92, normalized size = 1.59 \[ \frac {a^{2} \tan \left (d x +c \right )}{d}+\frac {2 a^{2}}{d \cos \left (d x +c \right )}+\frac {2 a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}+\frac {a^{2}}{d \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {2 a^{2} \cot \left (d x +c \right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c))^2,x)

[Out]

a^2*tan(d*x+c)/d+2/d*a^2/cos(d*x+c)+2/d*a^2*ln(csc(d*x+c)-cot(d*x+c))+1/d*a^2/sin(d*x+c)/cos(d*x+c)-2*a^2*cot(
d*x+c)/d

________________________________________________________________________________________

maxima [A]  time = 0.48, size = 72, normalized size = 1.24 \[ \frac {a^{2} {\left (\frac {2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - a^{2} {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )} + a^{2} \tan \left (d x + c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

(a^2*(2/cos(d*x + c) - log(cos(d*x + c) + 1) + log(cos(d*x + c) - 1)) - a^2*(1/tan(d*x + c) - tan(d*x + c)) +
a^2*tan(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 8.93, size = 86, normalized size = 1.48 \[ \frac {2\,a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {a^2-9\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}+\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*sin(c + d*x))^2/(cos(c + d*x)^2*sin(c + d*x)^2),x)

[Out]

(2*a^2*log(tan(c/2 + (d*x)/2)))/d - (a^2 - 9*a^2*tan(c/2 + (d*x)/2))/(d*(2*tan(c/2 + (d*x)/2) - 2*tan(c/2 + (d
*x)/2)^2)) + (a^2*tan(c/2 + (d*x)/2))/(2*d)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)**2*sec(d*x+c)**2*(a+a*sin(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________